<template>
    <input type="text" v-model="cityName">
</template>
<script setup>
import {watch,ref} from 'vue'
const cityName = ref('北京')
watch(cityName,(newVal,oldVal)=>{
    console.log(newVal,oldVal);
    
})
</script>